﻿namespace Hidistro.UI.SaleSystem.Tags
{
    using Hidistro.UI.Common.Controls;
    using System;
    using System.Web;
    using System.Web.UI.WebControls;
    using Juse.Interface;
    using System.Collections;
    using System.Collections.Generic;

    public class Common_TgSeo : AscxTemplatedWebControl
    {
        private Repeater rpt_yqlj;
        private int categoryId = 0;
        
        protected override void AttachChildControls()
        {
            BaseInfomation bi = new BaseInfomation();
            this.rpt_yqlj = (Repeater)this.FindControl("rpt_yqlj");
            int.TryParse(HttpContext.Current.Request.QueryString["CategoryId"], out this.categoryId);
            if (categoryId != 0)
            {
                Dictionary<string, string> dic = new Dictionary<string, string>();
                dic.Add("CategoryId", categoryId.ToString());
                IList<JSShop.Model.vw_Hishop_FriendlyLinks> list = new List<JSShop.Model.vw_Hishop_FriendlyLinks>();
                list = bi.GetFriendLinkList(dic);

                if ((list !=null)&&(list.Count > 0))
                {
                    rpt_yqlj.DataSource = list;
                    rpt_yqlj.DataBind();
                }
            }
        }

        protected override void OnInit(EventArgs e)
        {
            if (this.SkinName == null)
            {
                this.SkinName = "/ascx/tags/jsNewTags/Skin-Common_TgSeo.ascx";
            }
            base.OnInit(e);
        }
    }
}

